package com.rest.rfx;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import javax.jws.WebService;
import java.util.List;

/**
 * User: yuanjianpeng
 * Date: 2018/9/5
 * Project: webServiceServerTest
 * Version: 1.0
 * Description:
 */
@WebService
@RequestMapping("/user")
public interface UserService {

    //@GET
    //@Path({user})
    //@Produces(MediayType.APPLICATION_JSON) //编码格式，多个使用,隔开
    //此处要么使用"/getUsers/{user}"，在前端请求时直接挂参数，要么就是在前端用json，写明user中的参数
    @RequestMapping(value = "/getUsers",method = RequestMethod.GET)
    List<User> getUsers(@RequestParam("user") User user);

    @RequestMapping(value = "deleteUser",method = RequestMethod.DELETE)
    Response<Boolean> deleteUser(@RequestParam("userId") int userId);

    @RequestMapping(value = "updateUser",method = RequestMethod.PUT)
    Response<Boolean> updateUser(@RequestParam("user") User user);

    @RequestMapping(value = "addUser", method = RequestMethod.POST)
    Response<Boolean> addUser(@RequestParam("user") User user);

    @RequestMapping(value = "" ,method = RequestMethod.GET)
    User getUser(@RequestParam("userId") int userId);
}
